/*
 * CS_LOGOUT_GUILD_MEMBER.cpp
 *
 *  Created on: 2014. 7. 31.
 *      Author: spencer
 */




#include "../../User.h"
#include "../../Command.h"
#include "../../Proxy.h"

#include "../protocol/Guild.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_LOGOUT_GUILD_MEMBER(User * pUser, ::Network::Packet * pPacket)
{
/*

*/
	PREPARE_PACKET;

	if (0 >= pUser->GetUserInfo().guild_seq)
	{
//		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
//		*pAck << static_cast<int16_t>(ACK_UNKNOWN_ERROR);
//		pAck->MakePacket(CMD_SC_GUILD_MYINFO);
//		pUser->Send(pAck);
		return;
	}

	LogoutGuildMemberSyn syn;
	syn.user_seq	= pUser->GetUserSeq();
	syn.guild_seq	= pUser->GetGuildSeq();

//	DEBUGLOG("%s> user_seq: %d, guild_seq: %d"
//			, __FUNCTION__
//			, syn.user_seq, syn.guild_seq
//			);


	if (false == NProxy::SendGuildServer(pUser, syn))
	{
//		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
//		*pAck << static_cast<int16_t>(ACK_UNKNOWN_ERROR);
//		pAck->MakePacket(CMD_SC_GUILD_MYINFO);
//		pUser->Send(pAck);
		return;
	}
}

} /*NCommand*/ } /*ProjectZ*/
